// Copyright (c) 2010, SMB SAAS Systems Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must  retain  the  above copyright notice, this
//   list of conditions and the following disclaimer.
//
// - Redistributions in binary form  must  reproduce the  above  copyright  notice,
//   this list of conditions  and  the  following  disclaimer in  the documentation
//   and/or other materials provided with the distribution.
//
// - Neither  the  name  of  the  SMB SAAS Systems Inc.  nor   the   names  of  its
//   contributors may be used to endorse or  promote  products  derived  from  this
//   software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,  BUT  NOT  LIMITED TO, THE IMPLIED
// WARRANTIES  OF  MERCHANTABILITY   AND  FITNESS  FOR  A  PARTICULAR  PURPOSE  ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL,  SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO,  PROCUREMENT  OF  SUBSTITUTE  GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)  HOWEVER  CAUSED AND ON
// ANY  THEORY  OF  LIABILITY,  WHETHER  IN  CONTRACT,  STRICT  LIABILITY,  OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE)  ARISING  IN  ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.3053
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// 
// This source code was auto-generated by wsdl, Version=2.0.50727.42.
// 
using dotPanel.Providers.Common;
using dotPanel.Providers.ResultObjects;

namespace dotPanel.Providers.HostedSolution {
    using System.Diagnostics;
    using System.Web.Services;
    using System.ComponentModel;
    using System.Web.Services.Protocols;
    using System;
    using System.Xml.Serialization;
    
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="OrganizationsSoap", Namespace="http://tempuri.org/")]
    [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResultObject))]
    [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))]
    public partial class Organizations : Microsoft.Web.Services3.WebServicesClientProtocol {
        
        public ServiceProviderSettingsSoapHeader ServiceProviderSettingsSoapHeaderValue;
        
        private System.Threading.SendOrPostCallback OrganizationExistsOperationCompleted;
        
        private System.Threading.SendOrPostCallback CreateOrganizationOperationCompleted;
        
        private System.Threading.SendOrPostCallback DeleteOrganizationOperationCompleted;
        
        private System.Threading.SendOrPostCallback CreateUserOperationCompleted;
        
        private System.Threading.SendOrPostCallback DeleteUserOperationCompleted;
        
        private System.Threading.SendOrPostCallback GeUserGeneralSettingsOperationCompleted;
        
        private System.Threading.SendOrPostCallback SetUserGeneralSettingsOperationCompleted;
        
        private System.Threading.SendOrPostCallback DeleteOrganizationDomainOperationCompleted;
        
        private System.Threading.SendOrPostCallback CreateOrganizationDomainOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetPasswordPolicyOperationCompleted;
        
        /// <remarks/>
        public Organizations() {
            this.Url = "http://exchange-dev:9003/Organizations.asmx";
        }
        
        /// <remarks/>
        public event OrganizationExistsCompletedEventHandler OrganizationExistsCompleted;
        
        /// <remarks/>
        public event CreateOrganizationCompletedEventHandler CreateOrganizationCompleted;
        
        /// <remarks/>
        public event DeleteOrganizationCompletedEventHandler DeleteOrganizationCompleted;
        
        /// <remarks/>
        public event CreateUserCompletedEventHandler CreateUserCompleted;
        
        /// <remarks/>
        public event DeleteUserCompletedEventHandler DeleteUserCompleted;
        
        /// <remarks/>
        public event GeUserGeneralSettingsCompletedEventHandler GeUserGeneralSettingsCompleted;
        
        /// <remarks/>
        public event SetUserGeneralSettingsCompletedEventHandler SetUserGeneralSettingsCompleted;
        
        /// <remarks/>
        public event DeleteOrganizationDomainCompletedEventHandler DeleteOrganizationDomainCompleted;
        
        /// <remarks/>
        public event CreateOrganizationDomainCompletedEventHandler CreateOrganizationDomainCompleted;
        
        /// <remarks/>
        public event GetPasswordPolicyCompletedEventHandler GetPasswordPolicyCompleted;
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/OrganizationExists", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public bool OrganizationExists(string organizationId) {
            object[] results = this.Invoke("OrganizationExists", new object[] {
                        organizationId});
            return ((bool)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginOrganizationExists(string organizationId, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("OrganizationExists", new object[] {
                        organizationId}, callback, asyncState);
        }
        
        /// <remarks/>
        public bool EndOrganizationExists(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((bool)(results[0]));
        }
        
        /// <remarks/>
        public void OrganizationExistsAsync(string organizationId) {
            this.OrganizationExistsAsync(organizationId, null);
        }
        
        /// <remarks/>
        public void OrganizationExistsAsync(string organizationId, object userState) {
            if ((this.OrganizationExistsOperationCompleted == null)) {
                this.OrganizationExistsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnOrganizationExistsOperationCompleted);
            }
            this.InvokeAsync("OrganizationExists", new object[] {
                        organizationId}, this.OrganizationExistsOperationCompleted, userState);
        }
        
        private void OnOrganizationExistsOperationCompleted(object arg) {
            if ((this.OrganizationExistsCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.OrganizationExistsCompleted(this, new OrganizationExistsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateOrganization", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public Organization CreateOrganization(string organizationId) {
            object[] results = this.Invoke("CreateOrganization", new object[] {
                        organizationId});
            return ((Organization)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginCreateOrganization(string organizationId, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("CreateOrganization", new object[] {
                        organizationId}, callback, asyncState);
        }
        
        /// <remarks/>
        public Organization EndCreateOrganization(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((Organization)(results[0]));
        }
        
        /// <remarks/>
        public void CreateOrganizationAsync(string organizationId) {
            this.CreateOrganizationAsync(organizationId, null);
        }
        
        /// <remarks/>
        public void CreateOrganizationAsync(string organizationId, object userState) {
            if ((this.CreateOrganizationOperationCompleted == null)) {
                this.CreateOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrganizationOperationCompleted);
            }
            this.InvokeAsync("CreateOrganization", new object[] {
                        organizationId}, this.CreateOrganizationOperationCompleted, userState);
        }
        
        private void OnCreateOrganizationOperationCompleted(object arg) {
            if ((this.CreateOrganizationCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.CreateOrganizationCompleted(this, new CreateOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteOrganization", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public void DeleteOrganization(string organizationId) {
            this.Invoke("DeleteOrganization", new object[] {
                        organizationId});
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginDeleteOrganization(string organizationId, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("DeleteOrganization", new object[] {
                        organizationId}, callback, asyncState);
        }
        
        /// <remarks/>
        public void EndDeleteOrganization(System.IAsyncResult asyncResult) {
            this.EndInvoke(asyncResult);
        }
        
        /// <remarks/>
        public void DeleteOrganizationAsync(string organizationId) {
            this.DeleteOrganizationAsync(organizationId, null);
        }
        
        /// <remarks/>
        public void DeleteOrganizationAsync(string organizationId, object userState) {
            if ((this.DeleteOrganizationOperationCompleted == null)) {
                this.DeleteOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteOrganizationOperationCompleted);
            }
            this.InvokeAsync("DeleteOrganization", new object[] {
                        organizationId}, this.DeleteOrganizationOperationCompleted, userState);
        }
        
        private void OnDeleteOrganizationOperationCompleted(object arg) {
            if ((this.DeleteOrganizationCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.DeleteOrganizationCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateUser", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public void CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) {
            this.Invoke("CreateUser", new object[] {
                        organizationId,
                        loginName,
                        displayName,
                        upn,
                        password,
                        enabled});
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginCreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("CreateUser", new object[] {
                        organizationId,
                        loginName,
                        displayName,
                        upn,
                        password,
                        enabled}, callback, asyncState);
        }
        
        /// <remarks/>
        public void EndCreateUser(System.IAsyncResult asyncResult) {
            this.EndInvoke(asyncResult);
        }
        
        /// <remarks/>
        public void CreateUserAsync(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) {
            this.CreateUserAsync(organizationId, loginName, displayName, upn, password, enabled, null);
        }
        
        /// <remarks/>
        public void CreateUserAsync(string organizationId, string loginName, string displayName, string upn, string password, bool enabled, object userState) {
            if ((this.CreateUserOperationCompleted == null)) {
                this.CreateUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateUserOperationCompleted);
            }
            this.InvokeAsync("CreateUser", new object[] {
                        organizationId,
                        loginName,
                        displayName,
                        upn,
                        password,
                        enabled}, this.CreateUserOperationCompleted, userState);
        }
        
        private void OnCreateUserOperationCompleted(object arg) {
            if ((this.CreateUserCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.CreateUserCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteUser", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public void DeleteUser(string loginName, string organizationId) {
            this.Invoke("DeleteUser", new object[] {
                        loginName,
                        organizationId});
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginDeleteUser(string loginName, string organizationId, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("DeleteUser", new object[] {
                        loginName,
                        organizationId}, callback, asyncState);
        }
        
        /// <remarks/>
        public void EndDeleteUser(System.IAsyncResult asyncResult) {
            this.EndInvoke(asyncResult);
        }
        
        /// <remarks/>
        public void DeleteUserAsync(string loginName, string organizationId) {
            this.DeleteUserAsync(loginName, organizationId, null);
        }
        
        /// <remarks/>
        public void DeleteUserAsync(string loginName, string organizationId, object userState) {
            if ((this.DeleteUserOperationCompleted == null)) {
                this.DeleteUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteUserOperationCompleted);
            }
            this.InvokeAsync("DeleteUser", new object[] {
                        loginName,
                        organizationId}, this.DeleteUserOperationCompleted, userState);
        }
        
        private void OnDeleteUserOperationCompleted(object arg) {
            if ((this.DeleteUserCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.DeleteUserCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GeUserGeneralSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public OrganizationUser GeUserGeneralSettings(string loginName, string organizationId) {
            object[] results = this.Invoke("GeUserGeneralSettings", new object[] {
                        loginName,
                        organizationId});
            return ((OrganizationUser)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginGeUserGeneralSettings(string loginName, string organizationId, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("GeUserGeneralSettings", new object[] {
                        loginName,
                        organizationId}, callback, asyncState);
        }
        
        /// <remarks/>
        public OrganizationUser EndGeUserGeneralSettings(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((OrganizationUser)(results[0]));
        }
        
        /// <remarks/>
        public void GeUserGeneralSettingsAsync(string loginName, string organizationId) {
            this.GeUserGeneralSettingsAsync(loginName, organizationId, null);
        }
        
        /// <remarks/>
        public void GeUserGeneralSettingsAsync(string loginName, string organizationId, object userState) {
            if ((this.GeUserGeneralSettingsOperationCompleted == null)) {
                this.GeUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGeUserGeneralSettingsOperationCompleted);
            }
            this.InvokeAsync("GeUserGeneralSettings", new object[] {
                        loginName,
                        organizationId}, this.GeUserGeneralSettingsOperationCompleted, userState);
        }
        
        private void OnGeUserGeneralSettingsOperationCompleted(object arg) {
            if ((this.GeUserGeneralSettingsCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GeUserGeneralSettingsCompleted(this, new GeUserGeneralSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetUserGeneralSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public void SetUserGeneralSettings(
                    string organizationId, 
                    string accountName, 
                    string displayName, 
                    string password, 
                    bool hideFromAddressBook, 
                    bool disabled, 
                    bool locked, 
                    string firstName, 
                    string initials, 
                    string lastName, 
                    string address, 
                    string city, 
                    string state, 
                    string zip, 
                    string country, 
                    string jobTitle, 
                    string company, 
                    string department, 
                    string office, 
                    string managerAccountName, 
                    string businessPhone, 
                    string fax, 
                    string homePhone, 
                    string mobilePhone, 
                    string pager, 
                    string webPage, 
                    string notes, 
                    string externalEmail) {
            this.Invoke("SetUserGeneralSettings", new object[] {
                        organizationId,
                        accountName,
                        displayName,
                        password,
                        hideFromAddressBook,
                        disabled,
                        locked,
                        firstName,
                        initials,
                        lastName,
                        address,
                        city,
                        state,
                        zip,
                        country,
                        jobTitle,
                        company,
                        department,
                        office,
                        managerAccountName,
                        businessPhone,
                        fax,
                        homePhone,
                        mobilePhone,
                        pager,
                        webPage,
                        notes,
                        externalEmail});
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginSetUserGeneralSettings(
                    string organizationId, 
                    string accountName, 
                    string displayName, 
                    string password, 
                    bool hideFromAddressBook, 
                    bool disabled, 
                    bool locked, 
                    string firstName, 
                    string initials, 
                    string lastName, 
                    string address, 
                    string city, 
                    string state, 
                    string zip, 
                    string country, 
                    string jobTitle, 
                    string company, 
                    string department, 
                    string office, 
                    string managerAccountName, 
                    string businessPhone, 
                    string fax, 
                    string homePhone, 
                    string mobilePhone, 
                    string pager, 
                    string webPage, 
                    string notes, 
                    string externalEmail, 
                    System.AsyncCallback callback, 
                    object asyncState) {
            return this.BeginInvoke("SetUserGeneralSettings", new object[] {
                        organizationId,
                        accountName,
                        displayName,
                        password,
                        hideFromAddressBook,
                        disabled,
                        locked,
                        firstName,
                        initials,
                        lastName,
                        address,
                        city,
                        state,
                        zip,
                        country,
                        jobTitle,
                        company,
                        department,
                        office,
                        managerAccountName,
                        businessPhone,
                        fax,
                        homePhone,
                        mobilePhone,
                        pager,
                        webPage,
                        notes,
                        externalEmail}, callback, asyncState);
        }
        
        /// <remarks/>
        public void EndSetUserGeneralSettings(System.IAsyncResult asyncResult) {
            this.EndInvoke(asyncResult);
        }
        
        /// <remarks/>
        public void SetUserGeneralSettingsAsync(
                    string organizationId, 
                    string accountName, 
                    string displayName, 
                    string password, 
                    bool hideFromAddressBook, 
                    bool disabled, 
                    bool locked, 
                    string firstName, 
                    string initials, 
                    string lastName, 
                    string address, 
                    string city, 
                    string state, 
                    string zip, 
                    string country, 
                    string jobTitle, 
                    string company, 
                    string department, 
                    string office, 
                    string managerAccountName, 
                    string businessPhone, 
                    string fax, 
                    string homePhone, 
                    string mobilePhone, 
                    string pager, 
                    string webPage, 
                    string notes, 
                    string externalEmail) {
            this.SetUserGeneralSettingsAsync(organizationId, accountName, displayName, password, hideFromAddressBook, disabled, locked, firstName, initials, lastName, address, city, state, zip, country, jobTitle, company, department, office, managerAccountName, businessPhone, fax, homePhone, mobilePhone, pager, webPage, notes, externalEmail, null);
        }
        
        /// <remarks/>
        public void SetUserGeneralSettingsAsync(
                    string organizationId, 
                    string accountName, 
                    string displayName, 
                    string password, 
                    bool hideFromAddressBook, 
                    bool disabled, 
                    bool locked, 
                    string firstName, 
                    string initials, 
                    string lastName, 
                    string address, 
                    string city, 
                    string state, 
                    string zip, 
                    string country, 
                    string jobTitle, 
                    string company, 
                    string department, 
                    string office, 
                    string managerAccountName, 
                    string businessPhone, 
                    string fax, 
                    string homePhone, 
                    string mobilePhone, 
                    string pager, 
                    string webPage, 
                    string notes, 
                    string externalEmail, 
                    object userState) {
            if ((this.SetUserGeneralSettingsOperationCompleted == null)) {
                this.SetUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetUserGeneralSettingsOperationCompleted);
            }
            this.InvokeAsync("SetUserGeneralSettings", new object[] {
                        organizationId,
                        accountName,
                        displayName,
                        password,
                        hideFromAddressBook,
                        disabled,
                        locked,
                        firstName,
                        initials,
                        lastName,
                        address,
                        city,
                        state,
                        zip,
                        country,
                        jobTitle,
                        company,
                        department,
                        office,
                        managerAccountName,
                        businessPhone,
                        fax,
                        homePhone,
                        mobilePhone,
                        pager,
                        webPage,
                        notes,
                        externalEmail}, this.SetUserGeneralSettingsOperationCompleted, userState);
        }
        
        private void OnSetUserGeneralSettingsOperationCompleted(object arg) {
            if ((this.SetUserGeneralSettingsCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.SetUserGeneralSettingsCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteOrganizationDomain", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public void DeleteOrganizationDomain(string organizationDistinguishedName, string domain) {
            this.Invoke("DeleteOrganizationDomain", new object[] {
                        organizationDistinguishedName,
                        domain});
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginDeleteOrganizationDomain(string organizationDistinguishedName, string domain, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("DeleteOrganizationDomain", new object[] {
                        organizationDistinguishedName,
                        domain}, callback, asyncState);
        }
        
        /// <remarks/>
        public void EndDeleteOrganizationDomain(System.IAsyncResult asyncResult) {
            this.EndInvoke(asyncResult);
        }
        
        /// <remarks/>
        public void DeleteOrganizationDomainAsync(string organizationDistinguishedName, string domain) {
            this.DeleteOrganizationDomainAsync(organizationDistinguishedName, domain, null);
        }
        
        /// <remarks/>
        public void DeleteOrganizationDomainAsync(string organizationDistinguishedName, string domain, object userState) {
            if ((this.DeleteOrganizationDomainOperationCompleted == null)) {
                this.DeleteOrganizationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteOrganizationDomainOperationCompleted);
            }
            this.InvokeAsync("DeleteOrganizationDomain", new object[] {
                        organizationDistinguishedName,
                        domain}, this.DeleteOrganizationDomainOperationCompleted, userState);
        }
        
        private void OnDeleteOrganizationDomainOperationCompleted(object arg) {
            if ((this.DeleteOrganizationDomainCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.DeleteOrganizationDomainCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateOrganizationDomain", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public void CreateOrganizationDomain(string organizationDistinguishedName, string domain) {
            this.Invoke("CreateOrganizationDomain", new object[] {
                        organizationDistinguishedName,
                        domain});
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginCreateOrganizationDomain(string organizationDistinguishedName, string domain, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("CreateOrganizationDomain", new object[] {
                        organizationDistinguishedName,
                        domain}, callback, asyncState);
        }
        
        /// <remarks/>
        public void EndCreateOrganizationDomain(System.IAsyncResult asyncResult) {
            this.EndInvoke(asyncResult);
        }
        
        /// <remarks/>
        public void CreateOrganizationDomainAsync(string organizationDistinguishedName, string domain) {
            this.CreateOrganizationDomainAsync(organizationDistinguishedName, domain, null);
        }
        
        /// <remarks/>
        public void CreateOrganizationDomainAsync(string organizationDistinguishedName, string domain, object userState) {
            if ((this.CreateOrganizationDomainOperationCompleted == null)) {
                this.CreateOrganizationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrganizationDomainOperationCompleted);
            }
            this.InvokeAsync("CreateOrganizationDomain", new object[] {
                        organizationDistinguishedName,
                        domain}, this.CreateOrganizationDomainOperationCompleted, userState);
        }
        
        private void OnCreateOrganizationDomainOperationCompleted(object arg) {
            if ((this.CreateOrganizationDomainCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.CreateOrganizationDomainCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetPasswordPolicy", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public PasswordPolicyResult GetPasswordPolicy() {
            object[] results = this.Invoke("GetPasswordPolicy", new object[0]);
            return ((PasswordPolicyResult)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginGetPasswordPolicy(System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("GetPasswordPolicy", new object[0], callback, asyncState);
        }
        
        /// <remarks/>
        public PasswordPolicyResult EndGetPasswordPolicy(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((PasswordPolicyResult)(results[0]));
        }
        
        /// <remarks/>
        public void GetPasswordPolicyAsync() {
            this.GetPasswordPolicyAsync(null);
        }
        
        /// <remarks/>
        public void GetPasswordPolicyAsync(object userState) {
            if ((this.GetPasswordPolicyOperationCompleted == null)) {
                this.GetPasswordPolicyOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetPasswordPolicyOperationCompleted);
            }
            this.InvokeAsync("GetPasswordPolicy", new object[0], this.GetPasswordPolicyOperationCompleted, userState);
        }
        
        private void OnGetPasswordPolicyOperationCompleted(object arg) {
            if ((this.GetPasswordPolicyCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetPasswordPolicyCompleted(this, new GetPasswordPolicyCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        public new void CancelAsync(object userState) {
            base.CancelAsync(userState);
        }
    }
    
    
    
    
    
    
    
    
    
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void OrganizationExistsCompletedEventHandler(object sender, OrganizationExistsCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class OrganizationExistsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal OrganizationExistsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public bool Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((bool)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void CreateOrganizationCompletedEventHandler(object sender, CreateOrganizationCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class CreateOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal CreateOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public Organization Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((Organization)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void DeleteOrganizationCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void CreateUserCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void DeleteUserCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void GeUserGeneralSettingsCompletedEventHandler(object sender, GeUserGeneralSettingsCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GeUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GeUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public OrganizationUser Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((OrganizationUser)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void SetUserGeneralSettingsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void DeleteOrganizationDomainCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void CreateOrganizationDomainCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void GetPasswordPolicyCompletedEventHandler(object sender, GetPasswordPolicyCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetPasswordPolicyCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetPasswordPolicyCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public PasswordPolicyResult Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((PasswordPolicyResult)(this.results[0]));
            }
        }
    }
}
